﻿using BepInEx;
using System;
using UnityEngine;
using HarmonyLib;
using UnityEngine.UI;
using System.Reflection;
using System.Threading;
using System.Collections.Generic;
using System.Linq;

namespace tiandiguixu.foring
{
    /// <summary>
    /// 开局随机特性全是金色
    /// </summary>
    public partial class ForingMod
    {
        //private static List<string> Chara_Entrys = new List<string>();

        //[HarmonyPrefix, HarmonyPatch(typeof(CreateChara_RandomEntryPanel), "EntryEvent")]
        //public static void CreateChara_RandomEntryPanely_EntryEvent_Prefix(object[] __args)
        //{
        //    if (instance.CharaMinLevel.Value < 1) return;

        //    Chara_Entrys.Clear();
        //    Chara_Entrys.AddRange(AllDictionary.Chara_Entrys);
        //    AllDictionary.Chara_Entrys.Clear();
        //    AllDictionary.Chara_Entrys.AddRange(Chara_Entrys.Where(i => AllDictionary.Dic_EntryInfo[i].quality >= instance.CharaMinLevel.Value).Select(i => i).ToList());
        //    instance.Logger.LogInfo("CreateChara_RandomEntryPanely_EntryEvent_Prefix 替换 AllDictionary.Chara_Entrys " + Chara_Entrys.Count + " " + AllDictionary.Chara_Entrys.Count);
        //}

        //[HarmonyPostfix, HarmonyPatch(typeof(CreateChara_RandomEntryPanel), "EntryEvent")]
        //public static void CreateChara_RandomEntryPanely_EntryEvent_Postfix()
        //{
        //    if (instance.CharaMinLevel.Value < 1) return;

        //    AllDictionary.Chara_Entrys.Clear();
        //    AllDictionary.Chara_Entrys.AddRange(Chara_Entrys);
        //    instance.Logger.LogInfo("CreateChara_RandomEntryPanely_EntryEvent_Postfix 恢复 AllDictionary.Chara_Entrys " + AllDictionary.Chara_Entrys.Count);

        //}
        //[HarmonyPrefix, HarmonyPatch(typeof(CreateChara_RandomEntryPanel), "GetEntry")]
        //public static void CreateChara_RandomEntryPanely_GetEntry_Prefix(ref int RemainPoint, List<string> Entries, bool HaveBadEntry)
        //{
        //    if (instance.CharaMinLevel.Value < 1) return;

        //    instance.Logger.LogInfo("CreateChara_RandomEntryPanely_GetEntry_Prefix");
        //    instance.Logger.LogInfo("CreateChara_RandomEntryPanely_GetEntry_Prefix 剩余点数 ：" + RemainPoint);
        //    instance.Logger.LogInfo("CreateChara_RandomEntryPanely_GetEntry_Prefix 坏词条 ：" + HaveBadEntry);
        //    instance.Logger.LogInfo("CreateChara_RandomEntryPanely_GetEntry_Prefix 词条 ：" + String.Join("、", Entries));


        //    RemainPoint = 60;

        //}


    }
}
